//
//  ThirteenViewController.m
//  项目二
//
//  Created by rimi on 16/5/17.
//  Copyright © 2016年 objective. All rights reserved.
//

#import "ThirteenViewController.h"
#import <Masonry/Masonry.h>
#define SCREEN_WIDTH                [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT               [UIScreen mainScreen].bounds.size.height
@interface ThirteenViewController ()

@property(nonatomic,strong)UIImageView *viewqq;
@end

@implementation ThirteenViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"适配";
    [self.view addSubview:self.viewqq];
    [self Adaptive];  /**3方登录适配*/
    [self dsasd];    /**等比例适配*/
}
-(void)dsasd{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CRM(SCREEN_WIDTH *100/414, SCREEN_HEIGHT *100/736, SCREEN_WIDTH *100/414, SCREEN_HEIGHT *70/736);
    [button setTitle:@"适配" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor redColor];
    [self.view addSubview:button];
}

-(void)Adaptive{
    /**设置屏幕的长宽*/
    CGFloat width = CGRectGetWidth(self.view.bounds);
    CGFloat heigth = CGRectGetHeight(self.view.bounds);
   
    [self.viewqq mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@10);
        make.top.equalTo(@(30));
        make.size.mas_equalTo(CGSizeMake(width  - 20, heigth / 2));
    }];
    [self.viewqq layoutIfNeeded];
}
#pragma mark - GET
-(UIImageView *)viewqq{
    if (!_viewqq) {
        _viewqq = [[UIImageView alloc]init];
        _viewqq.image = [UIImage imageNamed:@"7"];
    }
    return _viewqq;
}

@end
